import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '方案编码',
    align:"center",
    dataIndex: 'caseCode'
   },
   {
    title: '方案名称',
    align:"center",
    dataIndex: 'caseName'
   },
   {
    title: '是否默认',
    align:"center",
    dataIndex: 'isDefault',
    editRow: true,
    editComponent: 'Switch',
   },
   {
    title: '方案是否启用',
    align:"center",
    dataIndex: 'caseStatus',
    editRow: true,
    editComponent: 'Switch',
   },
   {
    title: '显示排序',
    align:"center",
    dataIndex: 'displayOrder'
   },
   {
    title: '创建人',
    align:"center",
    dataIndex: 'sysCreatorId'
   },
   {
    title: '创建日期',
    align:"center",
    dataIndex: 'sysCreateDate'
   },
   {
    title: '储存字段',
    align:"center",
    dataIndex: 'saveCode'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    field: 'caseName',
    label: '模块名称',
    component: 'Input',
    colProps: { span: 8 },
  },
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '方案编码',
    field: 'caseCode',
    component: 'Input',
  },
  {
    label: '方案名称',
    field: 'caseName',
    component: 'Input',
  },
  {
    label: '默认开启',
    field: 'isDefault',
    component: 'Switch',
    defaultValue: 'false',
    componentProps: {
      checkedValue: 'true',
      unCheckedValue: 'false',
    },
  },
  {
    label: '方案是否启用',
    field: 'caseStatus',
    component: 'Switch',
    defaultValue: 'false',
    componentProps: {
      checkedValue: 'true',
      unCheckedValue: 'false',
    },
  },
  {
    label: '显示排序',
    field: 'displayOrder',
    component: 'InputNumber',
  },
  {
    label: '存储字段',
    field: 'saveCode',
    component: 'Select',
    required: true,
    componentProps: {
      options: [
        {
          label: 'elementScore1',
          value: 'elementScore1',
        },
        {
          label: 'elementScore2',
          value: 'elementScore2',
        },
        {
          label: 'elementScore3',
          value: 'elementScore3',
        },
        {
          label: 'elementScore4',
          value: 'elementScore4',
        },
        {
          label: 'elementScore5',
          value: 'elementScore5',
        },
        {
          label: 'elementScore6',
          value: 'elementScore6',
        },
        {
          label: 'elementScore7',
          value: 'elementScore7',
        },
        {
          label: 'elementScore8',
          value: 'elementScore8',
        },
        {
          label: 'elementScore9',
          value: 'elementScore9',
        },
        {
          label: 'elementScore10',
          value: 'elementScore10',
        },
      ],
    },
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  caseCode: {title: '方案编码',order: 0,view: 'text', type: 'string',},
  caseName: {title: '方案名称',order: 1,view: 'text', type: 'string',},
  isDefault: {title: '是否默认',order: 2,view: 'text', type: 'string',},
  caseStatus: {title: '方案是否启用',order: 3,view: 'text', type: 'string',},
  displayOrder: {title: '显示排序',order: 4,view: 'number', type: 'number',},
  sysCreatorId: {title: '创建人',order: 5,view: 'text', type: 'string',},
  sysCreateDate: {title: '创建日期',order: 6,view: 'datetime', type: 'string',},
  sysUpdatorId: {title: '修改人',order: 7,view: 'text', type: 'string',},
  sysUpdateDate: {title: '修改日期',order: 8,view: 'datetime', type: 'string',},
  saveCode: {title: '储存字段',order: 9,view: 'text', type: 'string',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}